package start;

import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.nio.SelectChannelConnector;
import org.eclipse.jetty.webapp.WebAppContext;

public class StartesmMain {
	public static void main(String[] args) {
		Server server = new Server();
		SelectChannelConnector connector = new SelectChannelConnector();
		connector.setPort(80);
		connector.setMaxIdleTime(1000 * 60 * 60);
		connector.setSoLingerTime(-1);
		server.setConnectors(new Connector[] { connector });
		WebAppContext web = new WebAppContext();
		// web.setParentLoaderPriority(true);// 改变默认的classload
		web.setContextPath("/");
		web.setWar("src/main/webapp");
		server.setHandler(web);
		try {
			System.out.println(">>> 启动项目服务...");
			System.out.println("在浏览器中打开 http://localhost:8003/ 访问系统");
			server.start();
			server.join();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(100);
		}
	}
}
